home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / E-G / educationstacks.sea / Circuits / card_3106.txt < prev    next >
Text File  |  1989-02-26  |  7KB  |  323 lines

  1. -- card: 3106 from stack: in
  2. -- bmap block id: 4455
  3. -- flags: 4000
  4. -- background id: 2693
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on calculate
  8.   get char 1 of card field "EMF"
  9.   if it="+" then
  10.     delete char 1 of card field "EMF"
  11.   end if
  12.   put card field "EMF" into E
  13.  
  14.   get char 1 of card field "R1"
  15.   if it="+" then
  16.     delete char 1 of card field "R1"
  17.   end if
  18.   put card field "R1" into R1
  19.   put abs(R1) into R1
  20.   put R1 into card field "R1"
  21.  
  22.   get char 1 of card field "R2"
  23.   if it="+" then
  24.     delete char 1 of card field "R2"
  25.   end if
  26.   put card field "R2" into R2
  27.   put abs(R2) into R2
  28.   put R2 into card field "R2"
  29.  
  30.   if E=0 then
  31.     send zeroall
  32.     exit calculate
  33.   end if
  34.  
  35.   if R1=0 and R2=0 then
  36.     put "zap" into card field "A1"
  37.     put 0 into card field "V1"
  38.     put 0 into card field "V2"
  39.     put 0 into card field "V3"
  40.     exit calculate
  41.   end if
  42.  
  43.   put E/(R1+R2) into I
  44.   put I*R1 into V1
  45.   put I*R2 into V2
  46.   set numberFormat to "0.000"
  47.   put I into card field "A1"
  48.   put V1 into card field "V1"
  49.   put V2 into card field "V2"
  50.   put E*1 into card field "V3"
  51.  
  52. end calculate
  53.  
  54. on closeField
  55.   set hilite of card button "S1 closed" to false
  56.   set hilite of card button "S1 middle" to true
  57.   set hilite of card button "S1 middle" to false
  58.   set hilite of card button "S1 open" to true
  59.   send zeroall
  60. end closeField
  61.  
  62. on zeroall
  63.   put 0 into card field "A1"
  64.   put 0 into card field "V1"
  65.   put 0 into card field "V2"
  66.   put 0 into card field "V3"
  67. end zeroall
  68.  
  69.  
  70.  
  71. -- part 1 (field)
  72. -- low flags: 00
  73. -- high flags: 0000
  74. -- rect: left=222 top=20 right=47 bottom=284
  75. -- title width / last selected line: 0
  76. -- icon id / first selected line: 0 / 0
  77. -- text alignment: 65535
  78. -- font id: 3
  79. -- text size: 18
  80. -- style flags: 256
  81. -- line height: 24
  82. -- part name: EMF
  83.  
  84.  
  85. -- part 2 (field)
  86. -- low flags: 00
  87. -- high flags: 0000
  88. -- rect: left=138 top=178 right=205 bottom=200
  89. -- title width / last selected line: 0
  90. -- icon id / first selected line: 0 / 0
  91. -- text alignment: 65535
  92. -- font id: 3
  93. -- text size: 18
  94. -- style flags: 256
  95. -- line height: 24
  96. -- part name: R1
  97.  
  98.  
  99. -- part 3 (field)
  100. -- low flags: 00
  101. -- high flags: 0000
  102. -- rect: left=300 top=179 right=206 bottom=362
  103. -- title width / last selected line: 0
  104. -- icon id / first selected line: 0 / 0
  105. -- text alignment: 65535
  106. -- font id: 3
  107. -- text size: 18
  108. -- style flags: 256
  109. -- line height: 24
  110. -- part name: R2
  111.  
  112.  
  113. -- part 4 (field)
  114. -- low flags: 01
  115. -- high flags: 0002
  116. -- rect: left=6 top=125 right=140 bottom=62
  117. -- title width / last selected line: 0
  118. -- icon id / first selected line: 0 / 0
  119. -- text alignment: 65535
  120. -- font id: 3
  121. -- text size: 10
  122. -- style flags: 256
  123. -- line height: 13
  124. -- part name: A1
  125.  
  126.  
  127. -- part 7 (field)
  128. -- low flags: 01
  129. -- high flags: 0002
  130. -- rect: left=232 top=133 right=148 bottom=292
  131. -- title width / last selected line: 0
  132. -- icon id / first selected line: 0 / 0
  133. -- text alignment: 65535
  134. -- font id: 3
  135. -- text size: 10
  136. -- style flags: 256
  137. -- line height: 13
  138. -- part name: V3
  139.  
  140.  
  141. -- part 8 (field)
  142. -- low flags: 01
  143. -- high flags: 0002
  144. -- rect: left=144 top=268 right=283 bottom=200
  145. -- title width / last selected line: 0
  146. -- icon id / first selected line: 0 / 0
  147. -- text alignment: 65535
  148. -- font id: 3
  149. -- text size: 10
  150. -- style flags: 256
  151. -- line height: 13
  152. -- part name: V1
  153.  
  154.  
  155. -- part 9 (field)
  156. -- low flags: 01
  157. -- high flags: 0002
  158. -- rect: left=308 top=268 right=283 bottom=364
  159. -- title width / last selected line: 0
  160. -- icon id / first selected line: 0 / 0
  161. -- text alignment: 65535
  162. -- font id: 3
  163. -- text size: 10
  164. -- style flags: 256
  165. -- line height: 13
  166. -- part name: V2
  167.  
  168.  
  169. -- part 10 (button)
  170. -- low flags: 00
  171. -- high flags: 4001
  172. -- rect: left=429 top=109 right=129 bottom=441
  173. -- title width / last selected line: 0
  174. -- icon id / first selected line: 0 / 0
  175. -- text alignment: 1
  176. -- font id: 0
  177. -- text size: 12
  178. -- style flags: 0
  179. -- line height: 16
  180. -- part name: S1 closed
  181. ----- HyperTalk script -----
  182. on mouseUp
  183.   get hilite of card button "S1 closed"
  184.   if it=true then
  185.     set hilite of card button "S1 closed" to false
  186.     set hilite of card button "S1 middle" to true
  187.     set hilite of card button "S1 middle" to false
  188.     set hilite of card button "S1 open" to true
  189.     send zeroall
  190.   else
  191.     set hilite of card button "S1 open" to false
  192.     set hilite of card button "S1 middle" to true
  193.     set hilite of card button "S1 middle" to false
  194.     set hilite of card button "S1 closed" to true
  195.     send calculate
  196.   end if
  197. end mouseUp
  198.  
  199.  
  200. -- part 11 (button)
  201. -- low flags: 00
  202. -- high flags: 0001
  203. -- rect: left=417 top=109 right=129 bottom=429
  204. -- title width / last selected line: 0
  205. -- icon id / first selected line: 0 / 0
  206. -- text alignment: 1
  207. -- font id: 0
  208. -- text size: 12
  209. -- style flags: 0
  210. -- line height: 16
  211. -- part name: S1 middle
  212. ----- HyperTalk script -----
  213. on mouseUp
  214.   get hilite of card button "S1 closed"
  215.   if it=true then
  216.     set hilite of card button "S1 closed" to false
  217.     set hilite of card button "S1 middle" to true
  218.     set hilite of card button "S1 middle" to false
  219.     set hilite of card button "S1 open" to true
  220.     send zeroall
  221.   else
  222.     set hilite of card button "S1 open" to false
  223.     set hilite of card button "S1 middle" to true
  224.     set hilite of card button "S1 middle" to false
  225.     set hilite of card button "S1 closed" to true
  226.     send calculate
  227.   end if
  228. end mouseUp
  229.  
  230.  
  231. -- part 12 (button)
  232. -- low flags: 00
  233. -- high flags: 0001
  234. -- rect: left=405 top=109 right=129 bottom=417
  235. -- title width / last selected line: 0
  236. -- icon id / first selected line: 0 / 0
  237. -- text alignment: 1
  238. -- font id: 0
  239. -- text size: 12
  240. -- style flags: 0
  241. -- line height: 16
  242. -- part name: S1 open
  243. ----- HyperTalk script -----
  244. on mouseUp
  245.   get hilite of card button "S1 closed"
  246.   if it=true then
  247.     set hilite of card button "S1 closed" to false
  248.     set hilite of card button "S1 middle" to true
  249.     set hilite of card button "S1 middle" to false
  250.     set hilite of card button "S1 open" to true
  251.     send zeroall
  252.   else
  253.     set hilite of card button "S1 open" to false
  254.     set hilite of card button "S1 middle" to true
  255.     set hilite of card button "S1 middle" to false
  256.     set hilite of card button "S1 closed" to true
  257.     send calculate
  258.   end if
  259. end mouseUp
  260.  
  261.  
  262. -- part 13 (button)
  263. -- low flags: 00
  264. -- high flags: 0000
  265. -- rect: left=443 top=110 right=129 bottom=504
  266. -- title width / last selected line: 0
  267. -- icon id / first selected line: 0 / 0
  268. -- text alignment: 1
  269. -- font id: 0
  270. -- text size: 12
  271. -- style flags: 0
  272. -- line height: 16
  273. -- part name: Switch
  274. ----- HyperTalk script -----
  275. on mouseUp
  276.   get hilite of card button "S1 closed"
  277.   if it=true then
  278.     set hilite of card button "S1 closed" to false
  279.     set hilite of card button "S1 middle" to true
  280.     set hilite of card button "S1 middle" to false
  281.     set hilite of card button "S1 open" to true
  282.     send zeroall
  283.   else
  284.     set hilite of card button "S1 open" to false
  285.     set hilite of card button "S1 middle" to true
  286.     set hilite of card button "S1 middle" to false
  287.     set hilite of card button "S1 closed" to true
  288.     send calculate
  289.   end if
  290. end mouseUp
  291.  
  292.  
  293. -- part contents for background part 8
  294. ----- text -----
  295. C2. Series
  296.  
  297. -- part contents for card part 4
  298. ----- text -----
  299. 0.800
  300.  
  301. -- part contents for card part 8
  302. ----- text -----
  303. 8.000
  304.  
  305. -- part contents for card part 9
  306. ----- text -----
  307. 16.000
  308.  
  309. -- part contents for card part 7
  310. ----- text -----
  311. 24.000
  312.  
  313. -- part contents for card part 1
  314. ----- text -----
  315. 24
  316.  
  317. -- part contents for card part 2
  318. ----- text -----
  319. 10
  320.  
  321. -- part contents for card part 3
  322. ----- text -----
  323. 20